<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class RelationshipModel extends CI_Model {

    const  TBL_BATE='contect';

    function __construct(){
        parent::__construct();
        $this->load->database(); //加载数据库配置
    }

    function getProInfo(){
        $cookie=$_COOKIE['phone'];//提取cookie里面的phone
        $a= $this->db->where('phone',$cookie)->select('relationship.id')->from('relationship')->join('user', 'user.id = relationship.user_id')->get()->row_array();
        return $info=$this->db->where('relationship_id',$a['id'])->get(self::TBL_BATE)->result_array();
    }

}